<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>手机号吉祥查询，手机号选号，自动扫描选号</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../../static/ydui/ydui.rem.css" th:href="@{/ydui/ydui.rem.css}"/>
    <link rel="stylesheet" href="../../static/ydui/ydui.base.css" th:href="@{/ydui/ydui.base.css}"/>
    <link rel="stylesheet" href="../../static/css/loading.css" th:href="@{/css/loading.css}"/>

    <link rel="stylesheet" href="../../static/css/wordflicker.css" th:href="@{/css/wordflicker.css}"/>
    <link rel="stylesheet" href="../../static/css/showlike.css" th:href="@{/css/showlike.css}"/>
    <!-- 引入rem自适应类库 -->
    <script src="../../static/ydui/ydui.flexible.js" th:src="@{/ydui/ydui.flexible.js}"></script>
    <script src="../../static/wxUtils.js" th:src="@{/wxUtils.js?v=20201227}"/></script>
    <style>
        .title_box{height: auto;background: url(./img/topbj.png) repeat-x; border: dotted 1px #c56202;}
        .title_box .yd-cell-right{min-height:0;}
        .title_text_box{margin: 5px;color: #c56202;font-size: 12px;line-height: 18px;}
        .help_text_box{margin: 5px;}
        .mobileinfo_box{text-align: left;min-height: 60px;width: 99%;}
        .mobile_flag{display: flex;}
        .sel_img_box{height: 200px; overflow-y: auto; position: relative;}
        .mobile_no_item{padding: 1 2; cursor:hand;}
        .yd-grids-2 .yd-grids-item {padding: 0.22rem 0 !important;}
        .radio_box{position: absolute;top:10px;}
        .radio_box .yd-radio-text{text-shadow:-1px 0 #FFF,0 -1px #FFF,1px 0 #FFF,0 1px #FFF;}
        .tip {
            width: 330px;
            height: 22px;
            left: 10%;
            border: 1px solid #d8c2a2;
            position: absolute;
            background-color: #fbfce1;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: space-evenly;
            margin-top:-25px;
        }
        .tip:before {
            bottom:-20px;
            left:50%;
            margin-left:-15px;
            height: 5px;
            border-top-color:#202020;
            border-style: dashed dashed solid;
            border-color:  transparent transparent #0099FF;
        }

    .img-card {
      position: relative;
      padding: 0.5 1;
      border-right: 2;
      overflow: auto;
    }
    .img-card .scan-contain {
      position: absolute;
      left: 0;
      right: 0;
      top: -100px;
      height: 100px;
      background: linear-gradient(rgba(98, 119, 60, 0), rgba(98, 119, 60, 0.7));
    }
    .img-card .scan-contain.active {
      animation: moveScan 1.5s infinite;
    }

      @keyframes moveScan {
        from {
          top: -100px;
        }
        to {
          top: 100%;
        }
      }
    </style>

</head>
<body>
<input type="hidden" name="openid" id="openid" th:attr="value=#{openid}"/>
<div id="pageLoading">
      <div class="loader-inner ball-beat">
        <div></div>
        <div></div>
        <div></div>
      </div>
</div>
<div id="app" v-cloak>
    <yd-layout>
        <yd-top slot="top" title="手机号吉祥" class="title_box">
            <yd-cell-item>
             <div slot="left">
                <yd-button size="mini" type="warning" @click.native="popupShow1 = true">手机AI智能选号</yd-button>
                <yd-icon slot="icon" name="good" size=".4rem" color="#c56202"></yd-icon>
              </div>
            <a href="mobileluck" slot="right">
                <yd-icon slot="icon" name="phone3" size=".4rem" color="#c56202"></yd-icon>
                <yd-button size="mini" type="primary" >输入手机号测算</yd-button>
            </a>
            </yd-cell-item>
        </yd-top>
        <yd-popup v-model="popupShow1" position="center" width="90%">
            <div class="title_text_box" style="background-color:#fff;border: dotted 1px #c56202;">
                <span class="flicker_sign" style="background-color:#c56202;">当<span class="fast-flicker">AI</span>智能<span class="flicker">遇上</span>易经</span>
                AI智能选好号，仅供趣味休闲，请勿沉迷。要坚信命运掌握在自己手里，努力才能创造美好未来！所谓“时来运转”，只是机会属于有准备的人；
                所谓“逆天改命”，只是因为一直在奋勇前行！
                <div style="color:red;">{{errMsg}}</div><br/>
            </div>
        </yd-popup>

        <div>
            <yd-tab v-model="tab1">
                <yd-tab-panel label="上传选号图" style="text-align: center;">
                    <div class="sel_img_box img-card">
                        <div :class="['scan-contain', { active: scanningStatus }]"></div>
                        <img :src="imageUrl" ref="imageView" alt="图片预览"/>
                    </div>
                    <input type="file" name="image" @change="selectImgFile" accept="image/*"/>
                    <yd-radio-group class="radio_box" v-model="picSizeType" :callback="picSizeDraw">
                        <yd-radio val="1">缩放1</yd-radio>
                        <yd-radio val="2">缩放2</yd-radio>
                        <yd-radio val="0">原图</yd-radio>
                    </yd-radio-group>
                </yd-tab-panel>
                <yd-tab-panel label="选号拍照" style="text-align: center;" v-show="showTip==false" th:if="${!clientIsMoblie}">
                    <div class="sel_img_box"> <!--  -->
                        <video ref="video" autoplay></video>
                    </div>
                    <yd-button bgcolor="blue" color="#FFF" @click.native="openMedia">打开摄像头</yd-button>
                    <yd-button type="primary" @click.native="takePhoto" :disabled="mediaOff">拍照</yd-button>
                    <yd-button type="danger" @click.native="closeMedia">关闭摄像头</yd-button>
                    <yd-button type="warning" @click.native="reversal" :disabled="mediaOff">镜头反转</yd-button>
                </yd-tab-panel>
                <yd-tab-panel label="拍照结果" style="text-align: center;">
                    <div class="sel_img_box">
                        <canvas ref="canvas" width="640" height="480"></canvas>
                    </div>
                    <div th:if="${!clientIsMoblie}"><span style="color:red;">{{takePhotoMsg}}</span><a ref="downAhref" alt="下载canvas图片">下载</a></div>
                </yd-tab-panel>
            </yd-tab>
            <yd-button-group>
                <div class="tip">{{showTipMsg}}
                    <yd-button bgcolor="blue" color="#FFF" style="height: 0.4rem;" @click.native="getSampleImg">样例选号图</yd-button></div>
                <yd-button size="large" type="primary" shape="circle"
                         @click.native="uploadImg1" :loading="uploading" loading-txt="上传图片并测算中..."
            		>开始测算-快速帮助选号</yd-button>
            </yd-button-group>
            <yd-cell-group>
                <yd-cell-item>
                    <div class="mobileinfo_head" slot="left">
                        <yd-icon slot="icon" name="verifycode" size=".45rem"></yd-icon>
                    </div>
                    <div class="mobileinfo_box" slot="right">
                        <yd-grids-group :rows="2">
                            <yd-grids-item v-for="(item,index) in mobileLucks" @click.native="showLuck(item)">
                                <span slot="text">
                                    <yd-badge slot="float" type="danger"  v-if="item.luckStatus=='吉'">吉</yd-badge>
                                    <yd-badge slot="float" type="warning" v-else-if="item.luckStatus=='吉带凶'">吉</yd-badge>
                                    <yd-badge slot="float" type="hollow"  v-else="">平</yd-badge>
								    <span class="mobile_no_item">{{item.mobilePhoneNumber}}</span>
                                </span>
                            </yd-grids-item>
                        </yd-grids-group>
                        <yd-popup v-model="showLuckBox" position="center" width="90%">
                            <div class="title_text_box" style="background-color:#fff;border: dotted 1px #c56202;">
                                <div><yd-badge type="hollow" color="#000" shape="square">{{viewMobileNumber}}</yd-badge>
                                    <yd-button size="mini" bgcolor="#999" color="#000" style="height: 0.4rem;" v-clipboard:copy="viewMobileNumber">复制号码</yd-button>
                                </div>
                                <div><yd-badge type="hollow">{{mobileLuckStatus}}</yd-badge>
                                    <span>{{mobileLuckInfo}}</span></div>
                                <div><yd-badge type="hollow" shape="square">{{fortuneStatus}}</yd-badge>
                                    <span>{{mobileFortune}}</span>
                                </div>
                            </div>
                        </yd-popup>
                    </div>
                </yd-cell-item>
            </yd-cell-group>

            <yd-step theme="1" current="3">
                <yd-step-item>
                    <span slot="bottom">上传选号图</span>
                </yd-step-item>
                <yd-step-item>
                    <span slot="bottom">或拍照选号界面</span>
                </yd-step-item>
                <yd-step-item>
                    <span slot="top">可拍照选号界面</span>
                    <span slot="bottom">自动测算帮助选号</span>
                </yd-step-item>
            </yd-step>
        </div>

        <yd-bottom slot="bottom">
            <yd-flexbox direction="vertical" class="title_box">

                <div class="help_text_box">
                    <b>手机号码测吉祥说明</b>：寓意吉祥的手机号码，可以提升我们的自信心，给我们积极正面的心理暗示，从而引导我们通过智慧和努力创造更美好的人生。
                    如果有条件的话，可以选用一个寓意吉祥的手机号码。不能更换也无须担心，号码只是生活的一部分，请保持心态平和，淡然面对就好。
                </div>
            </yd-flexbox>

        </yd-bottom>

    </yd-layout>
    <yd-popup v-model="popupShow2" position="center" close-on-masker="true" masker-opacity=".2" width="99%" height="90%"
              style="min-height: 100vh;overflow-y: scroll;position: fixed;top: 0;z-index:10;">
     <div v-show="isShowLike" ref="showLikeBox" style="height:600px;">
        <div v-for="(item,index) of showLikeList" ref='like' :style="{'backgroundImage':`url(${bgImage})`,'background-size':`100% 100%`}"
              :class="['showlike_like',{'like--is-second':index ==0 && secondShow},{'like--is-fith':index==1 && fithShow},{'like--is-right':index==2},
			   {'like--is-third':index ==3}, {'like--is-firth':index ==4},{'like--is-right':index==5 && fithShow},
			   {'like--is-six':index ==6},{'like--is-seven':index ==7},{'like--is-age':index ==8 && fithShow},
			   {'like--is-age':index ==9 && fithShow}
			   ]"></div>
     </div>
    </yd-popup>

</div>

<!-- 引入 Vue -->
<script src="../js/vue.min.js" th:src="@{/js/vue.min.js}"></script>
<script src="../js/axios.min.js" th:src="@{/js/axios.min.js}"></script>
<script src="../js/vue-clipboard.min.js" th:src="@{/js/vue-clipboard.min.js}"></script>
<!-- 引入组件库 -->
<script src="../ydui/ydui.rem.js" th:src="@{/ydui/ydui.rem.js}"></script>

<script th:inline="javascript">
/*<![CDATA[*/
	var openid = /*[[${openid}]]*/ '';
	const saasId = /*[[${saasId}]]*/ '01';
	const rdirFlag = /*[[${rdirFlag}]]*/ '';
	const redirectURL = /*[[${redirectURL}]]*/ '';
	const wxauthStatus = /*[[${wxauthStatus}]]*/ '';
	const ctx = /*[[@{/}]]*/ '\/lphone\/';
	const isWeixn = is_weixn();
	const isMobile = (navigator.userAgentData && navigator.userAgentData.mobile)
	            || /Mobi|Android|iPhone/i.test(navigator.userAgent);
	axios.defaults.baseURL = ctx+'api';
	defaultLuckInfo = "输入你的手机号就能AI测算出人生格局？";
	front = true;
	
	if (rdirFlag!='1' && (openid==null || openid=="" || openid=="def001") ) {
		openid = sessionStorage.getItem(saasId+"_session_openid");
		if (openid==null || openid=="") {
			if(!isWeixn) console.log("没用户openid，跳转通过微信授权取openid.isWeixn:"+isWeixn);
			if(isWeixn && redirectURL != '' && 1==2) {
				if (wxauthStatus != 'ok') {
					if(confirm('是否确认微信权限？\n以便进行业务功能操作。') ){
						window.location.replace(redirectURL);
					}
				} else {
					window.location.replace(redirectURL);
				} 				
			}
		}
	} else {
		sessionStorage.setItem(saasId+"_session_openid", openid);
	}

    function sleep(time){
     return new Promise((resolve) => setTimeout(resolve, time));
    }
/*]]>*/
 </script>
  
<script type="text/javascript">
 /*<![CDATA[*/
    new Vue({
        el: '#app',
        data() {
            return {
            	start1: false,
            	popupShow1: false,
            	popupShow2: false,
            	currstep: 1,
            	showTip: isMobile,
            	showTipMsg: "若手机可在[上传选号图]中拍照选号",
            	tab1: 0,
            	imageFile: null,
            	imageUrl: "",
            	imageSrcData: "",    // 上传时图片原数据
            	picSizeType: 1,
            	videoDevice: '',
            	errMsg: '',
            	takePhotoMsg: '',
            	mediaOff: true,
            	uploading: false,
            	scanningStatus: false,
            	mobileLucks: [],
                showLuckBox: false,
                mobileLuckInfo: defaultLuckInfo,
                viewMobileNumber: "",
                mobileLuckStatus: "",
                mobileFortune: "",
                fortuneStatus: "",
                saasId: saasId,
                openid: openid,
                isShowLike:false,  // 类似直播点赞的撒花动效
			   count:0,
			   likeIsNone:false,
			   showLikeList:10,
			   showSecond:false,
			   showFith:false,
			   secondShow:true,
			   fithShow:true,
			   bgImage: ctx+'img/showlike_lianhua.png'
            }
        },
        created:function () {
    		document.body.removeChild(document.getElementById('pageLoading'));
    		// console.log('bgImage',this.bgImage);
    	},
    	mounted: function() {
    		if (openid==null || openid=="" || openid=="def001" ) {
    			this.$dialog.notify({
                    mes: '没微信用户授权信息！',
                    timeout: 3000
                });
    		} else {
    			var _wxUIdialog = this.$dialog;
                var _this = this;
               	// 微信页面授权后，正常显示页面时，当前租户标志OK
    			axios.get(ctx + saasId + '/wxauthok')
    			.then(function (response) {s
            	  	if(!isWeixn) console.log(response);
            	 })
            	 .catch(function (error) {
            		 if(!isWeixn) console.log('error',error);
            		 _wxUIdialog.toast({
                        mes: '系统异常，请等下重试!',
                        timeout: 1500,
                        icon: 'error'
                    });
            	 });
    		}
    	},
		watch: {

    	},
    	computed: {
    		ecPhone: function() {
    			var reg = /^(\d{3})\d*(\d{4})$/;
    			var encodePhone = this.phone.replace(reg,'$1****$2');
    			return encodePhone;
    		},
    		wxUrl: function() {
    			return redirectURL;
    		},
    		helpUrl: function() {
    			var url = "https://mp.weixin.qq.com/s/kP6860qwEM2W2JGWeoeiww";
    			if (isWeixn && 1==2) {
    				return "http://mp.weixinbridge.com/mp/wapredirect?action=appmsg_redirect&uin=777&biz=MjM5ODY1MDg0MA==&mid=2751365251&idx=1&type=0&scene=0&url="+encodeURIComponent(url);
    			} else {
    				return url;
    			}
    		}
    	},
        methods: {
            selectImgFile: function (e) {
              var file = e.target.files[0];
              this.imageFile = file;

              var reader = new FileReader();
              var _this = this;
              reader.onload = function(e) {
                // _this.imageUrl = e.target.result;
                _this.imageSrcData = e.target.result;
                _this.takePhotoMsg = "已选好选号图片文件，可以快速AI选号测算！";
                _this.showTipMsg = "已选好选号图片文件，可以快速AI选号测算！";

                _this.picSizeDraw(_this.picSizeType);
                _this.imageFile = null;
              }

              if (typeof(file) === 'undefined' || file == null) { // this.imageFile
                this.imageUrl = '';
              } else {
                reader.readAsDataURL(file);
              }

            },
            picSizeDraw: function (val) {   // 上传图片大小处理
                // console.log('picSizeDraw',val);
                var _this = this;
                let img = new Image();
                img.onload = function() {  // 图件文件过太上传不了的要缩小
                  // console.log('imageView width:------', img.width);
                  if (val == 0) {
                    _this.imageUrl = _this.imageSrcData;
                    return;
                  }
                  let canvas = _this.$refs.canvas;
                  canvas.width = 300 * val;
                  canvas.height = 300 * val;
                  _this.scanningStatus = true;
                  let ctx = canvas.getContext("2d");
                  ctx.drawImage(img, 0, 0, 300* val, 300* val);
                  if (img.width > 600) {
                    sleep(1000);
                    _this.imageUrl = canvas.toDataURL('image/png');
                    let downAhref = _this.$refs.downAhref;
                    if(typeof(downAhref) != 'undefined' ) {
                        let imgdata = _this.imageUrl.replace('image/png', 'image/octet-stream');
                        downAhref.href = imgdata;
                        downAhref.download = "canvasImgFile.png";
                        // console.log('downAhref.href:------', downAhref.href);
                    }
                  }
                  sleep(2000);
                  _this.scanningStatus = false;
                }
                img.src = _this.imageSrcData;

            },
            showLuck: function (item) {   // 显示号码吉祥信息
                var _this = this;
                _this.showLuckBox = true;
                _this.viewMobileNumber = item.mobilePhoneNumber;
                _this.mobileLuckStatus = item.luckStatus;
                _this.mobileLuckInfo = item.meaning;
                _this.mobileFortune = item.fortune;
                _this.fortuneStatus = item.fortuneStatus;
            },

            // 开启摄像头
            async openMedia() {
              var _this = this;
              const srcVideo = this.$refs.video;
              let constraints = {
                audio: false, //音频轨道
                video: {
                  facingMode: front ? 'user' : 'environment',
                }, //视频轨道
              };
              const isWx = /micromessenger/i.test(navigator.userAgent) // 是否微信
              const isComWx = /wxwork/i.test(navigator.userAgent); // 是否企业微信
              // console.log("是否企业微信",isComWx);
              // console.log("是否微信",isWx);
              this.errMsg = "是否微信:"+isWx+",是否企业微信:"+isComWx;
              const mediaPromise =
                window.navigator.mediaDevices.getUserMedia(constraints);
              // console.log(navigator.mediaDevices);

              await mediaPromise
                .then(function (stream) {
                  /* 使用这个stream stream */
                  mediaStream = stream;
                  srcVideo.srcObject = stream;
                  srcVideo.onloadedmetadata = async () => {
                      await srcVideo.play();
                      _this.mediaOff = false;
                  };
                })
                .catch(function (err) {
                  /* 处理error */
                  this.errMsg = "开启摄像头错误"+err.message;
                  console.log("开启摄像头错误",err);
                });
            },
            // 拍照
            takePhoto() {
              const srcVideo = this.$refs.video;
              const width = srcVideo.videoWidth
              const height = srcVideo.videoHeight
              const canvas = this.$refs.canvas;  // document.createElement('canvas')
              //获取 `canvas`元素，根据`srcVideo`中的数据进行图片绘制 `ctx.drawImage()`；
              canvas.width = width
              canvas.height = height
              let ctx = canvas.getContext("2d");
              ctx.drawImage(srcVideo, 0, 0, width, height);
              this.takePhotoMsg = "选号图已拍下，可以进行快速选测算！";
              this.showTipMsg = "选号图已拍下，可以进行快速选测算！";
              this.tab1 = 2;
              //photo.src = canvas.toDataURL(); // const imageData = canvas.toDataURL('image/png');
              //imgbox.style.display = 'block';
            },
            // 关闭摄像头
            closeMedia() {
                var _this = this;
                return new Promise(reslove => {
                    mediaStream.getTracks().forEach(async(track) => {
                      await track.stop();
                      _this.mediaOff = true;
                    });
                    reslove();
                });
            },
            reversal() {  // 反转
                var _this = this;
                this.closeMedia().then(() => {
                    front = ! front;
                    _this.openMedia();
                });
            },
            showlike(e,numCount) {    // 类似直播点赞的撒花动效
                let _self = this;
                this.popupShow2 = true;
                const showLikeBox = this.$refs.showLikeBox;
                _self.count = 0;
                _self.isShowLike = true;
                _self.showSecond = false;
                _self.showFith = false;
                _self.secondShow = true;
                _self.fithShow = true;
                // console.log('numCount ------', numCount);
                if (typeof(numCount) == "undefined" || numCount == null || numCount == 0) {
                    numCount = 6;
                    console.log('未传入numCount 定为：6');
                }
                let arth_timer = setInterval(() => {
                    _self.count++;
                    // console.log('_self.count ------', _self.count);
                    if (_self.count == 1) {
                        _self.showSecond = true;
                    }
                    if (_self.count >= 4) {
                        _self.secondShow = false;
                        _self.$forceUpdate()
                    }
                    if (_self.count >= 5) {
                        _self.fithShow = false;
                    }
                    if (_self.count >= 6) {
                        clearInterval(arth_timer);
                    }
                    if (_self.count >= numCount) {
                        clearInterval(arth_timer);
                    }
                }, 1000)
                    setTimeout(() => {
                        this.isShowLike = false;
                        this.popupShow2 = false;
                }, numCount*1000);   // 6000
            },
            getSampleImg: function () {
                var _wxUIdialog = this.$dialog;
                var _this = this;
                let formData = new FormData(); // 向formData实例中追加属性 (参数1：属性名 参数2：属性值)
                formData.append('openid', openid);
                formData.append('saasId', this.saasId);
                axios.post('/getimg4sample', formData)
                	 .then(function (response) {
                		 if(!isWeixn) console.log(response);
                		 var res = response.data;
                	  	 if (res.code != 200) {
                	  		_wxUIdialog.toast({
                                mes: res.message,
                                timeout: 2500,
                                icon: 'error'
                            });
                	  	 } else {
                            _this.imageUrl = res.data;
                            _this.imageSrcData = res.data;
                            _this.imageFile = null;
                            _this.takePhotoMsg = "选号样例图已载入，可以体验AI选号测算！";
                            _this.showTipMsg = "选号样例图已载入，可以体验AI选号测算！";
                            _this.bgImage = ctx+'img/showlike_lianhua.png';
                            _this.showLikeList = 2;
                            _this.showlike(null, 1);
                	  	 }
                	 })
                	 .catch(function (error) {
                		 if(!isWeixn) console.log('error',error);
                		 _this.uploading = false;
                		 _wxUIdialog.toast({
                            mes: '系统异常，请等下重试!',
                            timeout: 2500,
                            icon: 'error'
                        });
                	 });
            },
            uploadImg1: function () {
                var _wxUIdialog = this.$dialog;
                var _this = this;
                if(this.uploading) {
                    _wxUIdialog.toast({
                        mes: '已提交了选号测算，不能重复提交！',
                        timeout: 1200,
                        icon: 'error'
                    });
                }
                if(this.tab1 == 2) {
                    const canvas = this.$refs.canvas;
                    this.imageUrl = canvas.toDataURL('image/png');
                }
                var luckNumCountup = this.$refs.luckNumCountup;
                if(this.imageUrl=="" || this.takePhotoMsg=="") {
                	_wxUIdialog.toast({
                        mes: '请上传选号图片或拍照选号图再测算！',
                        timeout: 1800,
                        icon: 'error'
                    });
                	_this.start1=false;
                	return;
                }
                this.uploading = true;
                this.scanningStatus = true;

                // this.$dialog.loading.open('测算中...');
                _this.mobileLuckInfo = defaultLuckInfo;
                _this.mobileFortune = "";
                _this.fortuneStatus = "";
                let formData = new FormData(); // 向formData实例中追加属性 (参数1：属性名 参数2：属性值)
                // formData.append('files',this.file); // const upfileconfig = {headers:{"Content-Type":"multipart/form-data"}}
                formData.append('openid', openid);
                formData.append('saasId', this.saasId);
                let mobilesUpImgUrl = '/mobilesimg2luck';
                if (typeof(this.imageFile) === 'undefined' || this.imageFile == null ) { // this.imageFile
                    formData.append('imgBase64', this.imageUrl);
                } else {
                    mobilesUpImgUrl = '/mobilesimgluck';
                    formData.append('imgFile', this.imageFile);
                }

                axios.post(mobilesUpImgUrl, formData)
                	 .then(function (response) {
                		 if(!isWeixn) console.log(response);
                		 var res = response.data;
                		 _this.uploading = false;
                	  	 if (res.code != 200) {
                	  		_wxUIdialog.toast({
                                mes: res.message,
                                timeout: 2500,
                                icon: 'error'
                            });
                	  		_this.start1=false;
                	  	 } else {
                            _this.mobileLucks = res.data;
                            let numCount = 0;
                            _this.mobileLucks.forEach((item, index) => {
                                    if (item.luckStatus && item.luckStatus.indexOf('吉') > -1) {
                                        numCount++;
                                    };
                                });
                            // console.log("统计'吉'"+numCount);
                            _this.showLikeList = numCount;
                            _this.bgImage = ctx+'img/showlike_ji.png';
                            _this.showlike(null, numCount);
                	  	 }
                	  	 _this.scanningStatus = false;
                	 })
                	 .catch(function (error) {
                		 if(!isWeixn) console.log('error',error);
                		 _this.uploading = false;
                		 _this.scanningStatus = false;
                		 _wxUIdialog.toast({
                            mes: '系统异常，请等下重试!',
                            timeout: 2500,
                            icon: 'error'
                        });
                	 });
                
                setTimeout(() => {

                    this.scanningStatus = false;
                    this.start1 = true;
                    this.$dialog.loading.close();

                }, 1000);
            }
    	
        }
    });
  /*]]>*/
</script>
</body>
</html>